package awk.polymorphic.controller;


import awk.model.animal.Beast;
import awk.model.animal.Lion;
import awk.model.animal.Tiger;
import awk.polymorphic.service.BeastService;
import org.apache.commons.lang.StringUtils;

/**
 * Project Name:jdbctemplate_demo <br/>
 * Package Name:com.nasus.controller <br/>
 * Date:2019/2/3 11:21 <br/>
 * <b>Description:</b> TODO: 描述该类的作用 <br/>
 *
 * @author <a href="turodog@foxmail.com">nasus</a><br/>
 */

public class TestController {

    public static void main(String[] args) {
        String animalName = "tiger";
        BeastService beastService = new BeastService();
        Beast beast = null;
        if (!StringUtils.isEmpty(animalName)){
            Lion lion = new Lion();
            lion.setAnimalName(animalName);
            beast = lion;
        }else {
            Tiger tiger = new Tiger();
            tiger.setAnimalName("tiger");
            beast = tiger;
        }
        beastService.sleep(beast);
    }


}
